home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / c / bc_ti.zip / TI712.ASC < prev    next >
Text File  |  1992-02-25  |  3KB  |  133 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.   PRODUCT  :  Borland C++                            NUMBER  :  712
  9.   VERSION  :  2.0
  10.        OS  :  DOS
  11.      DATE  :  February 25, 1992                        PAGE  :  1/2
  12.  
  13.     TITLE  :  Cursor Control Functions
  14.  
  15.  
  16.  
  17.  
  18.   These functions permit cursor control using the DOS Services.
  19.   They are not guaranteed to work on any given setup.
  20.  
  21.   The bottom line is: if they work for you, GREAT!
  22.  
  23.   /**********************************************************************/
  24.   #include <dos.h>
  25.  
  26.   int CURSOR = 7;
  27.  
  28.   /**********************************************************************/
  29.   /* Routine turns off the cursor on the default screen.
  30.   */
  31.   /**********************************************************************/
  32.   void cursor_off(void)
  33.   {
  34.           union REGS regs;
  35.           regs.x.ax = 0x0100;
  36.           regs.x.cx = 0x2000;
  37.           int86 (0x10, ®s, ®s);
  38.   }
  39.   /**********************************************************************/
  40.   /* Routine turns on the cursor on the default screen.
  41.   */
  42.   /**********************************************************************/
  43.   void cursor_on(void)
  44.   {
  45.           union REGS regs;
  46.           regs.x.ax = 0x0100;
  47.           regs.h.ch = CURSOR - 1;
  48.           regs.h.cl = CURSOR;
  49.           int86 (0x10, ®s, ®s);
  50.   }
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.   PRODUCT  :  Borland C++                            NUMBER  :  712
  75.   VERSION  :  2.0
  76.        OS  :  DOS
  77.      DATE  :  February 25, 1992                        PAGE  :  2/2
  78.  
  79.     TITLE  :  Cursor Control Functions
  80.  
  81.  
  82.  
  83.  
  84.   /**********************************************************************/
  85.   /* Routine changes the cursor size on the default screen.
  86.   */
  87.   /**********************************************************************/
  88.   void cursor_size(int lo, int hi)
  89.   {
  90.           union REGS regs;
  91.           regs.h.ah = 0x0001;
  92.           regs.h.ch = lo;
  93.           regs.h.cl = hi;
  94.           int86 (0x10, ®s, ®s);
  95.   }
  96.  
  97.   /**********************************************************************/
  98.   /* Routine to test the cursor functions.
  99.   */
  100.   /**********************************************************************/
  101.   #include <stdio.h>
  102.   void main(void)
  103.   {
  104.           int i;
  105.           printf("Changing cursor size:   ");
  106.           for (i=0; i<11; i++)
  107.           {
  108.                   cursor_size(0,i);
  109.                   delay(250);
  110.           }
  111.           cursor_size(6,7);
  112.           printf("\nThe cursor should be off!\n");
  113.           cursor_off();
  114.           sleep(3);
  115.           cursor_on();
  116.           printf("The cursor should be on!\n");
  117.   }
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.